<%@ page import="com.hqyj.zss.pojo.Customer" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();

%>

<html>
<head>
    <title>Document</title>
    <jsp:include page="common/css_js.jsp"/>
    <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="<%=path%>/static/css/home.css"/>
    <script src="<%=path%>/static/js/home.js"></script>

    <style>
        .body {
            background: url('<%=path%>/img/bgg2.jpg');
            background-repeat: no-repeat;
            background-size: 100% auto;

        }

        a:link {
            text-decoration: none;
        }
        a:active{
            text-decoration: none;
        }
        a:visited {

            text-decoration: none;
        }
        a:hover {
            text-decoration: none;
        }

    </style>
</head>
<body class="body">
<div class="container">
<div id="navv"  style="background-image: url('<%=path%>/img/dh.png')">
    <jsp:include page="Header.jsp"></jsp:include>
</div>

<div id="tp">
    <img src="<%=path%>/img/a1.png" width="1100" height="300" alt=""/>
</div>
<div id="food">
<div id="lunbo">
    <div class="layui-carousel" id="test10" lay-filter="test1">
        <div carousel-item="">
            <div><img src="<%=path%>/img/lb6.jpg" width="630" height="350" alt="" onclick=""/></div>
            <div><img src="<%=path%>/img/lb7.jpg" width="630" height="350" alt=""/></div>
            <div><img src="<%=path%>/img/lb8.jpg" width="630" height="350" alt=""/></div>
            <div><img src="<%=path%>/img/lb4.jpg" width="630" height="350" alt=""/></div>
            <div><img src="<%=path%>/img/lb5.jpg" width="630" height="350" alt=""/></div>
        </div>
    </div>
</div>

<div id="tp1">
    <img src="<%=path%>/img/nc.jpg" width="400" height="160" alt=""/>
</div>

<div id="tp2">
    <img src="<%=path%>/img/jm.png" width="400" height="160" alt=""/>
</div>
</div>
<div id="lf">
    <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="demo"
        style="margin-right: 10px; background-image: url('<%=path%>/img/dh.png'); width: 300px;">
        <li class="layui-nav-item layui-nav-itemed">
            <a href="javascript:;"><font color="#9ea09d" style="font-weight: bold">甄选美食</font></a>
            <dl class="layui-nav-child">
                <dd><a href="javascript:;" onclick="food('主食')"><img src="<%=path%>/img/zs2.png" alt=""/>&emsp;主食</a></dd>
                <dd><a href="javascript:;" onclick="snack('小吃')"><img src="<%=path%>/img/xc.png" alt=""/>&emsp;小吃</a></dd>
                <dd><a href="javascript:;" onclick="drink('饮品')"><img src="<%=path%>/img/yp.png" alt=""/>&emsp;饮品</a></dd>

            </dl>
        </li>
        <li class="layui-nav-item layui-nav-itemed">
            <a href="javascript:;"><font color="#9ea09d" style="font-weight: bold">默认展开</font></a>
            <dl class="layui-nav-child">
                <dd><a href="">移动模块</a></dd>
                <dd><a href="">今日推荐</a></dd>
                <dd><a href="">电商平台</a></dd>
            </dl>
        </li>
        <li class="layui-nav-item"><a href="javascript:;" onclick="personalInfo()"><font color="#9ea09d" style="font-weight: bold">个人信息</font></a></li>
        <li class="layui-nav-item"><a href=""><font color="#9ea09d" style="font-weight: bold">更多</font></a></li>
    </ul>
</div>

<div id="kf">
    &emsp;&emsp;&emsp;
    <img src="<%=path%>/img/wx.png" alt=""/>&emsp;&emsp;&emsp;
    <img src="<%=path%>/img/kf.png" alt=""/>&emsp;&emsp;&emsp;
    <img src="<%=path%>/img/app.png" alt=""/>
</div>



<div id="bq">

    <p align="center" >Copyright 2021-2022 @HQYJ </p>
</div>

<script>
    layui.use(['carousel', 'form'], function () {
        var carousel = layui.carousel
            , form = layui.form;

        var ins3 = carousel.render({
            elem: '#test3'
        });

        carousel.render({
            elem: '#test10'
            , width: '630px'
            , height: '350px'
            , interval: 5000
        });

        carousel.on('change(test4)', function (res) {
            console.log(res)
        });

        var $ = layui.$, active = {
            set: function (othis) {
                var THIS = 'layui-bg-normal'
                    , key = othis.data('key')
                    , options = {};

                othis.css('background-color', '#5FB878').siblings().removeAttr('style');
                options[key] = othis.data('value');
                ins3.reload(options);
            }
        };

        form.on('switch(autoplay)', function () {
            ins3.reload({
                autoplay: this.checked
            });
        });

        $('.demoSet').on('keyup', function () {
            var value = this.value
                , options = {};
            if (!/^\d+$/.test(value)) return;

            options[this.name] = value;
            ins3.reload(options);
        });

        $('.demoTest .layui-btn').on('click', function () {
            var othis = $(this), type = othis.data('type');
            active[type] ? active[type].call(this, othis) : '';
        });
    });
</script>
</div>
</body>
<script>
    function getShop(){
        $.ajax({
            url:"${pageContext.request.contextPath}/detailOrder/getShopCar",
            type: "post",
            success:function (result){
                alert("Yes")
            },
            error:function (err){
                alert("No")
            }
        })
    }

    function customerLogout() {
        $.ajax({
            url:"logout",
            success:function () {
            window.location="../index.jsp"
            }
        })
        // location.href="logout"
    }
    function personalInfo() {
        layer_show("个人信息","personalInfo")
    }

    function getMainMenu(){
        $.ajax({
            url:"${pageContext.request.contextPath}/food/staple_food",
            type:"post",
            success:function (result){
                alert("Yes")
            },
            error:function (err){
                alert("No")
            }
        })
    }



    function food(mClass) {

        $.ajax({
            url:"foodAllClass",
            method:"post",
            data:{
                mClass:mClass,
            },success:function (data) {
                if (data=='ok'){
                    location.reload();
                    location.href = "foodHome"
                }
            }
        })
    }

    function snack(mClass) {

        $.ajax({
            url:"foodAllClass",
            method:"post",
            data:{
                mClass:mClass,
            },success:function (data) {
                if (data=='ok'){
                    location.reload();
                    location.href = "snackHome"
                }
            }
        })
    }

    function drink(mClass) {

        $.ajax({
            url:"foodAllClass",
            method:"post",
            data:{
                mClass:mClass,
            },success:function (data) {
                if (data=='ok'){
                    location.reload();
                    location.href = "drinkHome"
                }
            }
        })
    }

    function meal() {
        location.href = "mealHome"
    }
</script>

</html>
